home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # ACTOR_PD.COG
- #
- #
- # Actor COG for Probe Droid
- # Possibly creates powerup upon death
- #
- #
- # [CR]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
- #
- # ========================================================================================
-
- symbols
-
- message killed
- message skill
- message damaged
-
- template powerup=+DShield local
- template powerup1=+DEnergyCell local
- thing newThing local
- flex rval local
- flex damage local
- flex damageType local
- int player local
-
- end
-
- # ========================================================================================
-
- code
-
- killed:
- rval = Rand();
- if (rval < 0.3)
- {
- newThing = CreateThing(powerup1, GetSenderRef());
- SetLifeleft(newThing, 200.0);
- }
- else if (rval < 0.4)
- {
- newThing = CreateThing(powerup, GetSenderRef());
- SetLifeleft(newThing, 200.0);
- }
- return;
-
- # ........................................................................................
-
- skill:
- ReturnEx(-1);
- return;
-
- damaged:
- damage = GetParam(0);
- damageType = GetParam(1);
-
- if(BitTest(damageType, 0x01))
- {
- damage = damage * 0.50;
- }
-
- player = GetLocalPlayerThing();
-
- if(GetThingParent(GetSourceRef()) == player)
- {
- if (GetCurWeapon(player) == 1)
- {
- if (GetThingHealth(player) > 1)
- {
- DamageThing(player, 1, 0x1, player);
- }
- }
- }
-
- ReturnEx(damage);
- return;
-
- end
-
-